package com.xxl.shoppingapp.ui;

import android.app.Activity;
import android.content.Intent;
import android.support.v4.app.Fragment;

import com.xxl.shoppingapp.base.CommonActivity;
import com.xxl.shoppingapp.ui.cart.OrderInfoFragment;
import com.xxl.shoppingapp.ui.main.MainActivity;
import com.xxl.shoppingapp.ui.user.LoginActivity;
import com.xxl.shoppingapp.ui.user.RegisterActivity;

/**
 * @author xuelian.xiong 2018/4/20
 * @Package com.xxl.shoppingapp.ui
 * @Title: ShopAppUIHelper
 * @Description: (用一句话描述该文件做什么)
 * Copyright (c) 传化公路港物流有限公司版权所有
 * Create DateTime: 2018/4/20
 */
public class ShopAppUIHelper {

    /**
     * 跳转注册
     * @param activity
     *      上下文
     */
    public static void navRegister(Activity activity) {
        Intent intent = new Intent(activity, RegisterActivity.class);
        activity.startActivity(intent);
    }

    /**
     * 跳转登陆
     * @param activity
     *      上下文
     */
    public static void navLogin(Activity activity) {
        Intent intent = new Intent(activity, LoginActivity.class);
        activity.startActivity(intent);
    }

    /**
     * 跳转首页
     * @param activity
     *      上下文
     */
    public static void navMain(Activity activity) {
        Intent intent = new Intent(activity, MainActivity.class);
        activity.startActivity(intent);
    }

    /**
     * 跳转首页
     * @param from
     *      上下文
     */
    public static void navDetail(Fragment from) {
        CommonActivity.showFromFragment(from, new OrderInfoFragment());
    }
}
